export function formatter(str = '') {
    let result = {
        province: '',
        city: '',
        detail: ''
    }

    let provinceRegExp = /(.+?(省|自治区))(.*)/
    let provinceList = str.match(provinceRegExp)

    let restStr = str
    if (provinceList) {
        result.province = provinceList[1]
        restStr = provinceList[3]
    }

    let cityRegExp = /(.+?(市|自治州|行政区))(.*)/
    let cityList = restStr.match(cityRegExp)
    if (cityList) {
        result.city = cityList[1]
        result.detail = cityList[3]
    }else {
        result.detail = restStr
    }

    console.log(result)
    return result
}
